{include file="header.htm" /}
<body class="bodystyle" style="overflow-y: scroll; cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    {include file="bar.htm" /}
    <div class="flexigrid">
        <div class="mDiv">
            <div class="ftitle">
                <div class="fbutton">
                    <a href="javascript:window.location.reload();">
                        <div class="add" title="刷新">
                            <span><i class="layui-icon layui-icon-refresh"></i>刷新</span>
                        </div>
                    </a>
                </div>
                <div class="fbutton">
                    <a href="javascript:void(0);" data-href="{:weapp_url('AirBottle/AirBottle/add')}" onclick="openFullframe(this, '新增气瓶');">
                        <div class="add">
                            <span><i class="layui-icon layui-icon-addition"></i>新增气瓶</span>
                        </div>
                    </a>
                </div>
                <div class="fbutton">
                    <a class="importImg" data-href="{:weapp_url('AirBottle/AirBottle/importImgNew')}">
                        <div class="add" title="导出二维码">
                            <span><i class="layui-icon layui-icon-addition"></i>导出二维码图片</span>
                        </div>
                    </a>
                </div>
            </div>
            <form class="navbar-form form-inline" action="{:weapp_url('AirBottle/AirBottle/index')}" method="get" onsubmit="layer_loading('正在处理');">
                {$searchform.hidden|default=''}
                <div class="sDiv">
                    <div class="sDiv2">
                        <input type="text" name="maf_date" class="qsbox maf_date" autocomplete="off" placeholder="按照生产日期查询" value="{$maf_date}" id="maf_date">
                    </div>
                    <div class="sDiv2">
                        <input type="text" size="30" name="batch" class="qsbox batch" value="{$batch}" placeholder="请输入批次" style="padding-right: 2px;">
                    </div>
                    <div class="sDiv2">
                        <input type="text" size="30" name="keywords" class="qsbox kw" value="{$kw}" placeholder="搜索相关数据...">
                        <input type="submit" class="btn" value="搜索">
                        <i class="fa fa-search"></i>
                    </div>
                </div>
            </form>
        </div>
        <div class="hDiv">
            <div class="hDivBox">
                <table cellspacing="0" cellpadding="0" style="width: 100%">
                    <thead>
                    <tr>
                        <th class="sign w40" axis="col0">
                            <div class="tc"><input type="checkbox" autocomplete="off" class="checkAll"></div>
                        </th>
                        <th abbr="ac_id" axis="col4">
                            <div style="text-align: left; padding-left: 10px;" class="">气瓶编号</div>
                        </th>
                        <th abbr="article_title" axis="col3" class="w100">
                            <div class="tc">二维码</div>
                        </th>
                        <th abbr="article_show" axis="col5" class="w200">
                            <div class="tc">产品标题</div>
                        </th>
                        <th abbr="article_show" axis="col5" class="w160">
                            <div class="tc">制造生产许可证</div>
                        </th>
                        <th abbr="article_title" axis="col3" class="w100">
                            <div class="tc">充装介质</div>
                        </th>

                        <th abbr="article_time" axis="col6" class="w100">
                            <div class="tc">生产日期</div>
                        </th>
                        <th abbr="article_time" axis="col6" class="w100">
                            <div class="tc">公称容积(L)</div>
                        </th>
                        <th abbr="article_time" axis="col6" class="w100">
                            <div class="tc">公称工作压力</div>
                        </th>
                        <th abbr="article_time" axis="col6" class="w100">
                            <div class="tc">批次号</div>
                        </th>
                        <th axis="col1" class="w200">
                            <div class="tc">操作</div>
                        </th>
                        <th abbr="article_show" axis="col5" class="w60">
                            <div class="tc">排序</div>
                        </th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
        <div class="bDiv" style="height: auto;">
            <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
                <table style="width: 100%">
                    <tbody>
                    {empty name="list"}
                        <tr>
                            <td class="no-data" align="center" axis="col0" colspan="50">
                                <div class="no_row">
                                    <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
                                </div>
                            </td>
                        </tr>
                    {else/}
                        {volist name="list" id="vo"}
                        <tr>
                            <td class="sign">
                                <div class="w40 tc"><input type="checkbox" name="ids[]" value="{$vo.id}"></div>
                            </td>
                            <td class="" style="width: 100%;">
                                <div class="tl" style="padding-left: 10px;">
                                    {$vo.code}
                                </div>
                            </td>
                            <td class="">
                                <div class="w100 tc">
                                    <span class="qr-code" data-code="{$vo.code}" data-url="{:weapp_url('AirBottle/AirBottle/qr','id='.$vo['id'])}" style="background: #18bc9c;padding:4px 3px 3px;color:#FFF;text-align: center;border-radius: 2px;cursor: pointer">
                                        <i class="fa fa-qrcode" style="font-size: 18px;margin-right: 2px;"></i></span>
                                </div>
                            </td>
                            <td class="sort">
                                <div class="w200 tc">
                                    {$vo.title}
                                </div>
                            </td>
                            <td class="sort">
                                <div class="w160 tc">
                                    {$vo.licence}
                                </div>
                            </td>
                            <td class="">
                                <div class="w100 tc">
                                    {$vo.dielectric}
                                </div>
                            </td>

                            <td class="">
                                <div class="w100 tc">
                                    {$vo.maf_date|MyDate='Y-m',###}
                                </div>
                            </td>
                            <td class="">
                                <div class="w100 tc">
                                    {$vo.capacity}
                                </div>
                            </td>
                            <td class="">
                                <div class="w100 tc">
                                    {$vo.pressure}
                                </div>
                            </td>
                            <td class="">
                                <div class="w100 tc">
                                    {$vo.batch}
                                </div>
                            </td>
                            <td class="operation">
                                <div class="w200 tc">
                                    <a href="javascript:void(0);" data-href="{:weapp_url('AirBottle/AirBottle/detail',array('id'=>$vo['id']))}" onclick="openFullframe(this, '详情');" class="btn blue">详情</a>
                                    <i></i>
                                    <a class="btn red"  href="javascript:void(0)" data-url="{:weapp_url('AirBottle/AirBottle/copy')}" data-id="{$vo.id}" onClick="copyfun(this);">复制</a>
                                    <i></i>
                                    <a href="javascript:void(0);" data-href="{:weapp_url('AirBottle/AirBottle/edit',array('id'=>$vo['id']))}" onclick="openFullframe(this, '编辑');" class="btn blue">编辑</a>
                                    <i></i>
                                    <a class="btn red"  href="javascript:void(0)" data-url="{:weapp_url('AirBottle/AirBottle/del')}" data-id="{$vo.id}" onClick="delfun(this);">删除</a>
                                </div>
                            </td>
                            <td class="sort">
                                <div class="w60 tc">
                                    <input style="text-align: left;" type="text" onkeyup="this.value=this.value.replace(/[^\d]/g,'');" onpaste="this.value=this.value.replace(/[^\d]/g,'');" onchange="changeTableVal('weapp_airbottle','id','{$vo.id}','sort_order',this);" size="4"  value="{$vo.sort_order}" />
                                </div>
                            </td>
                        </tr>
                        {/volist}
                    {/empty}
                    </tbody>
                </table>
            </div>
            <div class="iDiv" style="display: none;"></div>
        </div>
        <div class="tDiv">
            <div class="tDiv2">
                <div class="fbutton checkboxall">
                    <input type="checkbox" autocomplete="off" class="checkAll">
                </div>
                <div class="fbutton">
                    <a onclick="batch_del(this, 'ids');" data-url="{:weapp_url('AirBottle/AirBottle/del')}">
                        <div class="add">
                            <span>批量删除</span>
                        </div>
                    </a>
                </div>
                <div class="fbuttonr">
                    <div class="pages">
                       {$pageStr}
                    </div>
                </div>
                <div class="fbuttonr">
                    <div class="total">
                       <h5>共有{$pager->totalRows}条,每页显示
                            <select name="pagesize" style="width: 60px;" onchange="ey_selectPagesize(this);">
                                <option {if condition="$pager->listRows == 15"} selected {/if} value="15">15</option>
                                <option {if condition="$pager->listRows == 30"} selected {/if} value="30">30</option>
                                <option {if condition="$pager->listRows == 50"} selected {/if} value="50">50</option>
                                <option {if condition="$pager->listRows == 100"} selected {/if} value="100">100</option>
                                <option {if condition="$pager->listRows == 200"} selected {/if} value="200">200</option>
                                <!-- <option {if condition="$pager->listRows == 500"} selected {/if} value="500">500</option> -->
                            </select>
                       </h5>
                    </div>
                </div>
            </div>
            <div style="clear:both"></div>
        </div>
    </div>
</div>
<script type="text/javascript" src="__PUBLIC__/plugins/laydate/laydate.js"></script>
<script>
    var start = {
        elem: '#maf_date',//选择ID为START的input
        event:'click',
        format: 'YYYY-MM-DD',//自动生成的时间格式
    };
    laydate(start);
    $(".importImg").click(function () {
        var url =$(this).attr('data-href');
        var batch= $(".batch").val();
        var maf_date= $(".maf_date").val();
        var kw= $(".kw").val();
        if(batch){
            url+='&batch='+batch;
        }
        if(kw){
            url+='&kw='+kw;
        }
        if(maf_date){
            url+='&maf_date='+maf_date;
        }
        window.location.href=url;


    })
    $(".qr-code").click(function () {
        var url=$(this).attr('data-url');
        var code=$(this).attr('data-code');
        layer.open({
            type: 2,
            closeBtn: 1,
            title: ['防伪码:'+code, 'background:#F7F7F7 !important'],
            area: ['300px','400px'],
            content: url,
            success: function(layero, index){

            }
        });
    });
    $(document).ready(function(){
        // 表格行点击选中切换
        $('#flexigrid > table>tbody >tr').click(function(){
            $(this).toggleClass('trSelected');
        });

        // 点击刷新数据
        $('.fa-refresh').click(function(){
            location.href = location.href;
        });
        
        $('input[name*=ids]').click(function(){
            if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
                $('.checkAll').prop('checked','checked');
            } else {
                $('.checkAll').prop('checked', false);
            }
        });
        $('input[type=checkbox].checkAll').click(function(){
            $('input[type=checkbox]').prop('checked',this.checked);
        });
    });
</script>
{include file="footer.htm" /}
